<meta charset="utf-8">
<button id='btn'> click me </button>
<script>
function hello(){
 console.log('Hello world');
}

var button = document.getElementById("btn");

button.addEventListener('click', hello, false);
</script>